package com.job51.hro.exlog.interceptor;

import com.job51.hro.exlog.aspect.BaseAspect;
import feign.RequestInterceptor;
import feign.RequestTemplate;
import org.slf4j.MDC;
import org.springframework.context.annotation.Configuration;


/**
 * 〈一句话功能简述〉<br> 
 * 〈〉
 *
 * @author pengfei.ma
 * @create 2022/6/30
 * @since 1.0.0
 */
@Configuration
public class FeignRequestInterceptor implements RequestInterceptor {

    @Override
    public void apply(RequestTemplate template) {
        template.header(BaseAspect.GLOBAL_REQ_ID.toLowerCase(), MDC.get(BaseAspect.GLOBAL_REQ_ID));
    }
}
